﻿using System;

using CookComputing.XmlRpc;

namespace MolineSoftware.DrupalXmlRpc
{
    /// <summary>
    /// Struct: Container for Drupal file. 
    /// </summary>
    [XmlRpcMissingMapping(MappingAction.Ignore)]
    public struct DrupalFileNode
    {
        /// <summary>
        /// Gets the File ID
        /// </summary>
        [XmlRpcMember("fid")]
        public string FileID;

        /// <summary>
        /// Gest the UserID who submitted the file.
        /// </summary>
        [XmlRpcMember("uid")]
        public string UserID;

        /// <summary>
        /// Gets the name of the file.
        /// </summary>
        [XmlRpcMember("filename")]
        public string FileName;

        /// <summary>
        /// Gets the file location on the web server
        /// </summary>
        [XmlRpcMember("filepath")]
        public string FilePath;

        /// <summary>
        /// Gets the Size of the File.
        /// </summary>
        [XmlRpcMember("filesize")]
        public string FileSize;

        /// <summary>
        /// Gets the status. 
        /// </summary>
        [XmlRpcMember("status")]
        public string Status;

        /// <summary>
        /// Gets the File MIME type.
        /// </summary>
        [XmlRpcMember("filemime")]
        public string FileMIME;

        //TODO: Not Currently Implemented
        //[XmlRpcMember("file")]
        //public byte[] File;
    }
}

/*
Array
(
    [fid] => 1
    [uid] => 1
    [filename] => Exported-2009-02-11.vssettings
    [filepath] => sites/default/files/Exported-2009-02-11.vssettings
    [filemime] => application/octet-stream
    [filesize] => 660937
    [status] => 1
    [timestamp] => 1235941652
    [file] => 
)

 */
